unit ProdTestForm;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.ComCtrls, Vcl.TabNotBk,
  Vcl.StdCtrls, Vcl.ExtCtrls;

type
  TFrmProdTest = class(TForm)
    nb1: TTabbedNotebook;
    lbledtStartStationCode: TLabeledEdit;
    btnBcList: TButton;
    mmoBclist: TMemo;
    procedure btnBcListClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FrmProdTest: TFrmProdTest;

implementation
uses
  cnmd5, superobject, RSAOpenSSL, System.DateUtils, NetTicketModels, JsBusRequest;

{$R *.dfm}

procedure TFrmProdTest.btnBcListClick(Sender: TObject);
var
  jsReq: TBusRequest;
  reqObj: TRequestGetBusListObject;
  resp: TResponseGetBusListObject;
begin
  jsReq := TBusRequest.Create;
  try
    reqObj := TRequestGetBusListObject.Create;
    try
      reqObj.body.startstationcode := lbledtStartStationCode.Text;

      resp := jsReq.GetBusList(reqObj);
      try
        mmoBclist.Text := resp.ToJson().AsString;
      finally
        resp.Free;
      end;
    finally
      reqObj.Free;
    end;
  finally
    jsReq.Free;
  end;
end;

end.
